package com.shanzmoo.admin.domain.dto;

import cn.hutool.core.bean.BeanUtil;
import com.shanzmoo.db.store.entity.StoreReceiveBillDetailEntity;

import java.io.Serializable;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

/**
 * 仓库收货单明细 保存对象
 *
 * @author Gzhao 2021-03-11
 */
@Data
@ApiModel("仓库收货单明细-保存对象")
public class StoreReceiveBillDetailSaveDTO implements Serializable {

    private static final long serialVersionUID = 1L;

    @NotEmpty(message = "商品sku不允许为空")
    @ApiModelProperty(value = "商品sku")
    private String sku;

    @NotNull(message = "商品数量不允许为空")
    @ApiModelProperty(value = "商品数量")
    private Integer skuNum;

    public StoreReceiveBillDetailEntity convertEntity() {
        StoreReceiveBillDetailEntity target = new StoreReceiveBillDetailEntity();
        BeanUtil.copyProperties(this, target, true);
        return target;
    }
}
